package com.chenva;

import cn.hutool.core.util.RandomUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;

/**
 * 描述:123
 *
 * @author zhaojk
 * @since v1.0
 */
public class Test2 {
    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            Thread thread = new Thread(() -> {
                int randomInt = RandomUtil.randomInt(1, 3);
                String url = "http://127.0.0.1:8888/users?db=test" + randomInt;
                HttpRequest get = HttpUtil.createGet(url);
                HttpResponse response = get.execute(true);
                System.out.println(Thread.currentThread().getName() + ":" + url + ":" + response.body());
            });
            thread.start();
            System.out.println("线程" + thread.getName() + "启动");
        }
    }


}
